package com.wsx.ones.boots.grpc;

import lombok.Getter;

/**
 * @author wangshuaixin
 * @Title: com.wsx.ones.boots.grpc.GrpcSchema
 * @Description: TODO
 * @date 2019/05/21
 */
public enum GrpcSchema {

    CONSUL("consul"),
    ZOOKEEPER("zookeeper"),
    EUREKA("eureka");

    @Getter private String schema;
    GrpcSchema(String schema) {
        this.schema = schema;
    }

    public static GrpcSchema getGrpc(String schema) {
        GrpcSchema[] schemas = values();
        for (GrpcSchema grpcSchema : schemas) {
            if (grpcSchema.getSchema().equals(schema)) {
                return grpcSchema;
            }
        }
        return null;
    }
}
